package ysq.xyg.model;

import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.Date;

/**
 * 网站部分-资讯内容
 */
@Table(name = "web_information")
@Data
@NoArgsConstructor
public class Information implements Serializable {

    @Id
    private String id;

    @Column(name = "catalog_id")
    private String catalogId;

    /**
     * 标题
     */
    private String title;

    /**
     * 显示图片
     */
    @Column(name = "show_pic")
    private String showPic;

    /**
     * 介绍
     */
    private String description;

    /**
     * 内容
     */
    private String content;

    /**
     * 状态：1、有效，2、无效
     */
    private String status;

    /**
     * 首页展示：1、是，2、否
     */
    @Column(name = "show_frist")
    private String showFrist;

    private int sort;

    @Column(name = "create_time")
    private Date createTime;

    @Transient
    private String catalogName;

    public Information(String catalogId, String status, String showFrist) {
        this.catalogId = catalogId;
        this.status = status;
        this.showFrist = showFrist;
    }

    public Information(String status) {
        this.status = status;
    }

    public Information(String status, String showFrist) {
        this.status = status;
        this.showFrist = showFrist;
    }
}